import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home.vue'
import login from '../views/login.vue'
import layout from '../views/layout/index.vue'
import sub from '../views/layout/sub.vue'
import first from '../views/layout/first.vue'

const routes = [
  {
    path: '/login',
    component: login
  },
  {
    path: '/',
    component: layout,
    children: [
      {
        path: 'first/:id?',
        component: first
      },
      {
        path: 'first/sub/:id?',
        component: sub
      },
    ]
  },

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
